<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<style>
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        background-color: brown;
    }

    .login {
        position: relative;
    }

    .hd {
        font-size: 18px;
        color: white;
        text-align: center;
        margin-top: 6px;
    }

    .logo {
        position: absolute;
        left: 140px;
        top: 90px;
        width: 100px;
        height: 100px;
    }

    .logo img {
        width: 100%;
        height: 100%;
    }

    .login-bottom {
        position: absolute;
        width: 400px;
        height: 200px;
        top: 350px;
        padding-left: 45px;
        padding-top: 70px;
    }

    h2 {
        display: inline-block;
        margin-right: 20px;
        color: white;
        font-size: 17px;
    }

    input::placeholder {
        color: white;
        font-size: 1.2em;
    }

    input:-internal-autofill-selected {
        -webkit-text-fill-color: brown !important;
        transition: background-color 5000s ease-in-out 0s !important;
    }

    input {
        -webkit-text-fill-color: white;
    }

    input {
        background-color: brown;
    }

    input :hover {
        border: 2px white solid;
    }

    .input1 {
        display: inline-block;
        border: 2px white solid;
        width: 250px;
        height: 30px;
        margin-bottom: 50px;
    }

    .input2 {
        display: inline-block;
        border: 2px solid white;
        width: 250px;
        height: 30px;
        margin-bottom: 40px;
    }

    .btn {
        position: absolute;
        width: 300px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        top: 650px;
        left: 50px;
        border-radius: 20px;
        background-color: aliceblue;
    }

    .btn a {
        font-size: 18px;
        line-height: 18px;
        color: grey;
        text-decoration: none;
    }

    .sucess {
        
        top: 200px;
        left: 100px;
        position: absolute;
        width: 200px;
        height: 200px;
        background-color: black;
        padding-left: 20px;
    }

    .picture {
        width: 150px;
        height: 150px;
    }

    .picture img {
        width: 100%;
        height: 100%;
    }

    h3 {
        margin-left: 30px;
        color: white;
    }
</style>

<body>
    <div class="login">
        <div class="hd">网易云音乐</div>
        <div class="logo">
            <img src="img/网易云音乐 (2).png" alt="">
        </div>
<div style="display: none;"></div>
        <div class="login-bottom">
            <h2>账号 </h2><input class="input1" type="text" name="" id="" placeholder="输入手机号"><br>
            <h2>密码</h2><input class="input2" type="text" name="" id="" placeholder="输入密码">
        </div>

        <button class="btn"><a href="#">登入</a></button>
        <div class="nosucess ">
            <div class="picture">
                <img src="img/对勾.png" alt="">
            </div>
            <h3>登入成功</h3>
        </div>
    </div>
    <script>
        let input1 = document.querySelector(".input1")
        let input2 = document.querySelector(".input2")
        let btn = document.querySelector(".btn")
        let sucess = document.querySelector(".sucess")
        btn.addEventListener('click', () => {
            fetch(`http://192.168.1.83:3000/login?username=${input1.value}&password=${input2.value}`)
                .then((res) => {
                    //  console.log(res)   //响应体
                    return res.json()
                })
                .then((data) => 
                {
                    console.log(data)
                    
                })
            
                
                                   
        })

    </script>
</body>

</html>